{extend name="layout"}

{block name="content"}
<div class="layui-card">
    <div class="layui-card-header">
        <h3>广告统计 - {$info.title}</h3>
    </div>
    <div class="layui-card-body">
        <!-- 基本信息 -->
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header">总点击量</div>
                    <div class="layui-card-body">
                        <h2 class="layui-text-center">{$statistics.total_clicks ?? 0}</h2>
                    </div>
                </div>
            </div>
            <div class="layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header">今日点击</div>
                    <div class="layui-card-body">
                        <h2 class="layui-text-center">{$statistics.today_clicks ?? 0}</h2>
                    </div>
                </div>
            </div>
            <div class="layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header">本周点击</div>
                    <div class="layui-card-body">
                        <h2 class="layui-text-center">{$statistics.week_clicks ?? 0}</h2>
                    </div>
                </div>
            </div>
            <div class="layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header">本月点击</div>
                    <div class="layui-card-body">
                        <h2 class="layui-text-center">{$statistics.month_clicks ?? 0}</h2>
                    </div>
                </div>
            </div>
        </div>

        <!-- 广告信息 -->
        <div class="layui-card" style="margin-top: 15px;">
            <div class="layui-card-header">广告信息</div>
            <div class="layui-card-body">
                <table class="layui-table">
                    <tr>
                        <td width="120">广告ID</td>
                        <td>{$info.id}</td>
                    </tr>
                    <tr>
                        <td>广告标题</td>
                        <td>{$info.title}</td>
                    </tr>
                    <tr>
                        <td>广告位置</td>
                        <td>{$info.position_text ?? ''}</td>
                    </tr>
                    <tr>
                        <td>链接地址</td>
                        <td>{$info.link_url}</td>
                    </tr>
                    <tr>
                        <td>状态</td>
                        <td>
                            {if condition="$info.status == 1"}
                            <span class="layui-badge layui-bg-green">启用</span>
                            {else/}
                            <span class="layui-badge">禁用</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <td>创建时间</td>
                        <td>{$info.create_time}</td>
                    </tr>
                </table>
            </div>
        </div>

        <!-- 操作按钮 -->
        <div class="layui-form-item" style="margin-top: 15px;">
            <div class="layui-input-block">
                {if condition="isset($info.id)"}
                <a href="{:url('advertisementEdit', ['id' => $info.id])}" class="layui-btn">编辑广告</a>
                {/if}
                <a href="{:url('advertisementList')}" class="layui-btn layui-btn-primary">返回列表</a>
            </div>
        </div>
    </div>
</div>
{/block}